import React, { Component } from 'react'

export default function WithFrom(WrappedComponent) {
   return  class withComponent extends Component {
       state = {
         username: "",
         password: "",
         repassword: "",
       };

       handleChange = (name) => (e) => {
         this.setState({
           [name]: e.target.value,
         });
       };
       render() {
           return (
             <WrappedComponent
               state={this.state}
               handleChange={this.handleChange}
             ></WrappedComponent>
           );
       }
     }
}

    
   
